home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / nn.zip / M-TEMPLA.H < prev    next >
C/C++ Source or Header  |  1989-12-30  |  2KB  |  82 lines

  1.  
  2. /************** Machine (and compiler) dependent definitions. **************
  3.  *
  4.  *    Define appropriate types for the following ranges of integer
  5.  *    variables.  These are processor & compiler dependent, but the
  6.  *    distributed definitions will probably work on most systems.
  7.  */
  8.  
  9.  
  10.  
  11. /*      MACHINE TYPE    DEFINED TYPE        VALUE RANGE    */
  12.  
  13. typedef unsigned char    int8;        /*        0 ..     255 */
  14. typedef short        int16;        /*  -10,000 ..  10,000 */
  15. typedef long        int32;        /* -100,000 .. 100,000 */
  16. typedef unsigned long    uint32;        /*       0 ..  2^31-1 */
  17.  
  18.  
  19. /*
  20.  *     Define NO_VARARGS if the varargs feature is not available
  21.  *
  22.  *    Also define NO_VARARGS if the vprintf/vsprintf routines are not
  23.  *    available (however, this will only by safe on some machines, like
  24.  *    the VAX).
  25.  *    
  26.  */
  27.  
  28. /* #define NO_VARARGS */
  29.  
  30. /*
  31.  *    Define STRCSPN if the strcspn() function is not available.
  32.  */
  33.  
  34. /* #define STRCSPN     /* */
  35.  
  36. /*
  37.  *    Define NO_SIGINTERRUPT on BSD based systems which don't have
  38.  *    a siginterrupt() function, but provides an SV_INTERRUPT flag
  39.  *    in <signal.h>.
  40.  */
  41.  
  42. /* #define NO_SIGINTERRUPT    /* */
  43.  
  44.  
  45. #ifdef NETWORK_DATABASE
  46.  
  47. /*
  48.  *    Define NETWORK_BYTE_ORDER if the machine's int32's are
  49.  *    already in network byte order, i.e. m68k based.
  50.  */
  51.  
  52. #define NETWORK_BYTE_ORDER    /* */
  53.  
  54. /*
  55.  *    OTHERWISE provide the functions/macros ntohl/htonl to
  56.  *    convert longs from and to network byte order
  57.  */
  58.  
  59. #ifndef NETWORK_BYTE_ORDER
  60.  
  61. /*
  62.  * Include appropriate files or define macroes or functions (include them 
  63.  * in data.c) to convert longs and shorts to and from network byte order.
  64.  */
  65.  
  66. /*
  67.  * This will work on most BSD based systems...
  68.  */
  69.  
  70. #include <netinet/in.h>
  71.  
  72. /*
  73.  * Otherwise, define something appropriate below
  74.  */
  75.  
  76. #define htonl(l)    ...    /* host long to network long */
  77. #define ntohl(l)    ...    /* network long to host long */
  78.  
  79. #endif    /* not NETWORK BYTE ORDER */
  80.  
  81. #endif    /* NETWORK DATABASE */
  82.